﻿using System;
using System.Web.Security;

namespace RockPaperScissors.Web
{
    public partial class Main : System.Web.UI.MasterPage
    {
        public Messages SiteMessages { get; set; }

        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (Membership.GetUser() != null)
                pnlHeader.Visible = true;

            if (SiteMessages != null)
                litStatus.Text = SiteMessages.ToString();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.SiteMessages = new Messages();
        }

        protected void lnkAdminLogout_Click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();
            Session.Abandon();
            Response.Redirect("~/Login.aspx");
        }
    }
}